﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QUANLYDIEMHOCSINH
{
    public partial class QUANLYDIEMHOCSINH : Form
    {
        public QUANLYDIEMHOCSINH()
        {
            InitializeComponent();
            set_AN();
            DANGNHAP dangnhap = new DANGNHAP();
            dangnhap.ShowDialog();
        }
        void set_AN()
        {
            if (File.Exists("AnhNen.txt"))
            {
                FileStream fs = new FileStream("AnhNen.txt", FileMode.Open);
                StreamReader sr = new StreamReader(fs);
                string s = null;
                string t = null;
                while ((s = sr.ReadLine()) != null)
                {
                    t = s;
                }
                this.BackColor = Color.FromName(t);
                fs.Close();
            }
            else
            {
                FileStream fs = new FileStream("AnhNen.txt", FileMode.Append);
                StreamWriter sw = new StreamWriter(fs);
                sw.WriteLine("Turquoise");
                sw.Flush();
                sw.Close();
                fs.Close();

                FileStream fs1 = new FileStream("AnhNen.txt", FileMode.Open);
                StreamReader sr1 = new StreamReader(fs1);
                string s = null;
                string t = null;
                while ((s = sr1.ReadLine()) != null)
                {
                    t = s;
                }
                this.BackColor = Color.FromName(t);
                fs1.Close();
            }
        }
        private void xemThôngTinHọcSinhToolStripMenuItem_Click(object sender, EventArgs e)
        {
            XemthongtinHS xemth = new XemthongtinHS();
            xemth.ShowDialog();
        }

        private void xepToolStripMenuItem_Click(object sender, EventArgs e)
        {
            xemxeploaihs xeploaihs = new xemxeploaihs();
            xeploaihs.ShowDialog();
        }

        private void giáoViênNhậpĐiểmToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GVNHAPDIEM gvnhapdiem = new GVNHAPDIEM();
            gvnhapdiem.ShowDialog();
        }

        private void xemInPhiếuĐiểmToolStripMenuItem_Click(object sender, EventArgs e)
        {
            XEM_IN_PHIEUDIEM xemin = new XEM_IN_PHIEUDIEM();
            xemin.ShowDialog();
        }

        private void lậpBáoCáoĐiểmToolStripMenuItem_Click(object sender, EventArgs e)
        {
            THONGKE tk = new THONGKE();
            tk.ShowDialog();
        }

        private void QUANLYDIEMHOCSINH_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void quảnLýThamSốToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Thamso ts = new Thamso();
            ts.ShowDialog();
        }

        private void quảnLýTàiKhoảnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QUANLYTAIKHOAN QLTK = new QUANLYTAIKHOAN();
            QLTK.ShowDialog();
        }

        private void chọnMàuNềnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ChinhAnhNen ca = new ChinhAnhNen();
            ca.ShowDialog();
            set_AN();
        }
    }
}
